package com.pureut.storage.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pureut.storage.domain.PickingSchemeStrategy;
import com.pureut.storage.mapper.PickingSchemeStrategyMapper;
import com.pureut.storage.service.PickingSchemeStrategyService;
import com.sale.common.mybatis.core.page.PageQuery;
import com.sale.common.mybatis.core.page.TableDataInfo;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/***
 *
 * Author:C
 * Date:2022/12/21 17:29
 * @DESC
 */
@Service
@RequiredArgsConstructor
public class PickingSchemeStrategyServiceImpl implements PickingSchemeStrategyService {

    private final PickingSchemeStrategyMapper pickingSchemeStrategyMapper;

    /**
     * 获取拣货策略分页列表
     * @param id
     * @return
     */
    @Override
    public TableDataInfo<PickingSchemeStrategy> getStrategyList(Long id, PageQuery pageQuery) {
//        List<PickingSchemeStrategy> pickingSchemeStrategies = pickingSchemeStrategyMapper.selectList(new QueryWrapper<PickingSchemeStrategy>()
//            .lambda().eq(PickingSchemeStrategy::getPickingId, id));

        Page<PickingSchemeStrategy> pickingSchemeStrategyPage = pickingSchemeStrategyMapper.selectPickingSchemeStrategyList(id, pageQuery.build());

//        Page<PickingSchemeStrategy> page = new Page<>();
//        Page<PickingSchemeStrategy> pickingSchemeStrategyPage = page.setRecords(pickingSchemeStrategies);
        return TableDataInfo.build(pickingSchemeStrategyPage);
    }
}
